package com.codingvip.str;

import java.util.HashMap;

/**
 * @Author Tony.Han
 * @Created at 2020/4/4 8:56 下午
 * Desc:
 */
public class PaiLie {

    public boolean canPermutePalindrome(String st1) {

        HashMap<Character,Integer> baseCount=new HashMap();
        char s1;
        for(int i=0;i<st1.length();i++){
            s1 = st1.charAt(i);
            baseCount.put(s1, baseCount.getOrDefault(s1, 0) + 1);
        }
        int count=0;
        for (Character s : baseCount.keySet()) {
            count=count+baseCount.get(s)%2;
        }
        return count <= 1;

    }


}
